home *** CD-ROM | disk | FTP | other *** search
/ Meeting Pearls 2 / Meeting Pearls Vol. II (1995)(GTI - Schatztruhe)[!].iso / Pearls / dev / GUI / gengui / Gengui.doc < prev    next >
Text File  |  1994-05-03  |  24KB  |  725 lines

  1.  
  2.                            GenGui V1.0
  3.                            ===========
  4.  
  5.                     ©1994 by Matthias Meixner
  6.  
  7.                Read the README file for the legal issues
  8.  
  9.  
  10.  
  11. This package is for layout and creation of graphical user interfaces (GUI).
  12. Unlike some other programs like Gadtools, you do not draw your GUI just like
  13. in a paint-program, but you describe the GUI in a kind of description
  14. language. From this description GenGui generates a C-headerfile, wich
  15. containes the description data in a form that is needed by the routines
  16. which must be linked to your program and which do the real work on runtime.
  17.  
  18.  
  19. 1. The basic idea:
  20. ==================
  21.  
  22. The description of the Gui is box oriented. Every box affects the size
  23. and position of the objects inside the box. A box has an orientation, which
  24. determines the positions of the objects in a box, in a vertical box the
  25. first object is on top and all other objects are below this one, in a
  26. horizontal box, the first one is on the most left side. Within a box every
  27. object can have a relative size, a size absolut in characters or a size
  28. absolut in pixels or a mixture of the last two. This object can be a new box,
  29. a gadget or a custom "gadget". This allows an easy generation of resizeable
  30. GUI's.
  31.  
  32. Maybe you should get an example now:
  33.  
  34. Imagine you want to have a GUI, which looks like that:
  35.  
  36.  
  37. +-------------------------+
  38. |                         |
  39. | +-----+ +-----+ +-----+ |
  40. | |Text1| |Text2| |Text3| |
  41. | +-----+ +-----+ +-----+ |
  42. |                         |
  43. |                         |
  44. |                         |
  45. +-------------------------+
  46.  
  47. The description would look like this:
  48.  
  49. PROJECTNAME Project1 // This is the name, which will be used
  50.                      // in the generated source
  51.  
  52. HBOX                 // horizontal box
  53.    VREL 1            // the box has relative height
  54.    HREL 1            // and relative width
  55.    BUTTON            // We want to generate a button
  56.       STDLINE 1      // with a height of one line plus spacing
  57.       HREL 1         // and relative width
  58.       TEXT "Text1"   // "Text1" should be written in it
  59.       ID   1         // and maybe we want to identify it later
  60.    END
  61.    BUTTON
  62.       STDLINE 1
  63.       HREL 1
  64.       TEXT "Text2"
  65.       ID   2
  66.    END
  67.    BUTTON
  68.       STDLINE 1
  69.       HREL 1
  70.       TEXT "Text3"
  71.       ID   3
  72.    END
  73. END
  74.  
  75. This would describe a GUI with three gadgets, each has (including an adequate
  76. spacing) one third of the width of the window, and a height of one line.
  77.  
  78. Gengui offers some reasonable defaultvalues for the different types of
  79. objects, which significantly reduce the size of the description:
  80.  
  81.  
  82. PROJECTNAME Project1
  83. HBOX
  84.    BUTTON
  85.       TEXT "Text1"
  86.       ID   1
  87.    END
  88.    BUTTON
  89.       TEXT "Text2"
  90.       ID   2
  91.    END
  92.    BUTTON
  93.       TEXT "Text3"
  94.       ID   3
  95.    END
  96. END
  97.  
  98.  
  99. Maybe you want the first button to be double as wide as the other two
  100. buttons:
  101.  
  102.  
  103. PROJECTNAME Project1
  104. HBOX
  105.    BUTTON
  106.       HREL 2        // now this button gets 2 parts of the width of this box
  107.       TEXT "Text1"
  108.       ID   1
  109.    END
  110.    BUTTON           // whereas this button gets only one part,
  111.       TEXT "Text2"
  112.       ID   2
  113.    END
  114.    BUTTON           // and this one too
  115.       TEXT "Text3"
  116.       ID   3
  117.    END
  118. END
  119.  
  120.  
  121.  
  122. Now lets think of something like that:
  123.  
  124. +-----------------+
  125. |                 |
  126. | +-------------+ |
  127. | |             | |
  128. | +-------------+ |
  129. |                 |
  130. | +--------+      |
  131. | |        |      |
  132. | +--------+      |
  133. |                 |
  134. | +---+           |
  135. | |   |           |
  136. | +---+           |
  137. |                 |
  138. +-----------------+
  139.  
  140. The first button has three times the size and the second one two times the
  141. size of the last button.
  142.  
  143.  
  144. PROJECTNAME Project1
  145. VBOX                    // Now one button is above the other !
  146.    BUTTON
  147.       HREL 3            // Three thimes the size
  148.       TEXT "Text1"
  149.       ID   1
  150.    END
  151.    BUTTON
  152.       HREL 2            // two times the size of the last button.
  153.       TEXT "Text2"
  154.       ID   2
  155.    END
  156.    BUTTON
  157.       TEXT "Text3"
  158.       ID   3
  159.    END
  160. END
  161.  
  162.  
  163.  
  164. And now a last example for this topic:
  165.  
  166. +---------------+
  167. |               |
  168. |      +------+ |
  169. |      |      | |
  170. |      +------+ |
  171. |               |
  172. | +--+ +------+ |
  173. | |  | |      | |
  174. | |  | |      | |
  175. | |  | |      | |
  176. | |  | |      | |
  177. | +--+ +------+ |
  178. |               |
  179. +---------------+
  180.  
  181. PROJECTNAME Pro2
  182. HBOX
  183.  
  184.    VBOX        // left box
  185.       HREL 1
  186.  
  187.       VBOX     // this creates the empty place in the top left corner
  188.       END
  189.  
  190.       BUTTON
  191.          VREL2
  192.       END
  193.    END
  194.  
  195.    VBOX        // right box
  196.       HREL 2   // of double width
  197.  
  198.       BUTTON
  199.          VREL 1
  200.       END
  201.  
  202.       BUTTON
  203.          VREL 2
  204.       END
  205.    END
  206.  
  207. END
  208.  
  209.  
  210.  
  211. 2. The description language
  212. ===========================
  213.  
  214. These are keywords for the description languange. It does not distinguish
  215. between lower- and uppercase. Some keywords more than one name, since i could
  216. not decide wich one would be more easy to remember :). These other names
  217. can be found in the brackets ().
  218.  
  219. Every command must be on a separate line, comments begin with '//' and mark
  220. the rest of the line as comment.
  221.  
  222. #c_source
  223. #end_source
  224.  
  225.    Everything between these two lines will be directly included in the
  226.    generated output. These keywords must begin on the first column !
  227.  
  228.  
  229. These are the commands that are used to describe the objects of the GUI:
  230.  
  231. BUTTON
  232.    BUTTON   : Normal button, default size HREL 1, STDLINE 1
  233.  
  234. CHECKBOX
  235.    CHECKBOX : Checkbox, default size HCAR 2, VCHAR 1
  236.  
  237.  
  238. CUSTOM
  239.    CUSTOM   : Custom Gadget, default size HREL 1, VREL 1,
  240.               Read also the chapter about custom gadgets !
  241.  
  242. CYCLE
  243.    CYCLE    : Cycle-gadget, default size HREL 1, STDLINE 1
  244.  
  245. HBOX
  246.    HBOX     : horizontal box, default size: HREL 1, VREL 1
  247.  
  248. INTEGER
  249.    INTEGER  : Integer-gadget, default size HREL 1, STDLINE 1
  250.  
  251. LISTVIEW
  252.    LISTVIEW : default size HREL 1, VREL 1
  253.  
  254. MX
  255.    MX       : MX-gadget, default size HREL 1, VREL 1
  256.  
  257. NUMBER
  258.    NUMBER   : Number-gadget, default size HREL 1, STDLINE 1
  259.  
  260. PALETTE
  261.    PALETTE  : Palette-gadget, default size HREL 1, VREL 1
  262.  
  263. SCROLLER
  264.    SCROLLER : Scroller, default size HREL 1, VREL 1
  265.  
  266. SLIDER
  267.    SLIDER   : Slider, default size HREL 1, VREL 1
  268.  
  269. STRING
  270.    STRING   : String-gadget, default size HREL 1, STDLINE 1
  271.  
  272. TEXT
  273.    TEXT     : Text-gadget, default size HREL 1, STDLINE 1
  274.  
  275. VBOX
  276.    VBOX     : vertical box, default size: HREL 1, VREL 1
  277.  
  278.  
  279. Each of these commads defines a block, which must be terminated by "END"
  280.  
  281.  
  282.  
  283.  
  284. Commands specifying the size of the objects:
  285.  
  286. HCHAR (XCHAR)
  287.    HCHAR chars   : Absolute width of 'chars' characters
  288.  
  289. HPIX (XPIX)
  290.    HPIX pixel    : Absolute width of 'pixel' pixels
  291.  
  292. HREL (XREL)
  293.    HREL size     :  Relative width
  294.  
  295. STDCOL
  296.    STDCOL chars  : Absolute width of 'chars' characters plus 4 pixels space
  297.  
  298. STDLINE
  299.    STDLINE chars : Absolute height of 'chars' characters plus 4 pixels space
  300.  
  301. VCHAR (YCHAR)
  302.    VCHAR chars   : Absolute height of 'chars' characters
  303.  
  304. VPIX (YPIX)
  305.    VPIX pixel    : Absolute height of 'pixel' pixels
  306.  
  307. VREL (YREL)
  308.    VREL size     : Relative height
  309.  
  310. XSPACE
  311.    XSPACE xs     : Set the amount of horizontal space between gadgets to
  312.                    xs pixels, defaults to INTERWIDTH
  313.                    (only allowed within HBOX/VBOX)
  314. YSPACE
  315.    YSPACE ys     : Set the amount of vertical space between gadgets to
  316.                    ys pixels, defaults to INTERHEIGHT
  317.                    (only allowed within HBOX/VBOX)
  318.  
  319.  
  320.  
  321. Commands for the description of gadget-specific data:
  322.  
  323. CUSTOM
  324.    CUSTOM func   : Set the custom function for custom-gadgets.
  325.                    NOTE: this is only valid within a custom-object and since
  326.                          it is written the same way as the CUSTOM-object
  327.                          the meaning of CUSTOM only depends on the context.
  328.  
  329. FLAGS
  330.    FLAGS flagset : Set the flags of the gadget (-> ng_Flags)
  331.                    NOTE: it is possible spread the flags to more than one
  332.                          FLAGS command e.g.:
  333.  
  334.                             FLAGS a|b
  335.  
  336.                          would have the same effect as
  337.  
  338.                             FLAGS a
  339.                             FLAGS b
  340.  
  341.  
  342. HOOK
  343.    HOOK function : Set a hook function that is called, when the gadget sends
  344.                    a message. See also the chapter on hook-functions.
  345.  
  346. ID
  347.    ID id         : Set the ID of the gadget (-> ng_GadgetID)
  348.                    NOTE: id must not contain any whitespace characters !
  349.  
  350.  
  351. TAGS
  352.    TAGS tags     : Set the tags for a gadget. You need not set TAG_DONE,
  353.                    since this is automatically done. You may use more than
  354.                    one TAGS command per gadget, e.g.
  355.  
  356.                      TAGS a,b
  357.                      TAGS c,d
  358.  
  359.                    would have the same effect as
  360.  
  361.                      TAGS a,b,c,d
  362.  
  363. TEXT
  364.    TEXT string   : Set the text for the gadget (-> ng_GadgetText)
  365.  
  366. TEXTATTR
  367.    TEXTATTR textattr : Set ng_TextAttr. By default the standart font of the
  368.                        window is used for the gadgets.
  369.  
  370. USER
  371.    USER userdata : Set user data. You can access the user data via the
  372.                    macro GetUserData().
  373.                    NOTE: the field ng_UserData is required by GenGui itself,
  374.                          but therefore it has another field reserved for
  375.                          this purpose.
  376.  
  377.  
  378. General note: The parameters of all these commands may be preprocessor
  379.               symbols, in fact they are just passed on to the generated
  380.               source.
  381.  
  382.  
  383. 3. What's generated by GenGui
  384. =============================
  385. GenGui takes the descriptionfile and generates two headerfile. The first
  386. headerfile contains the full data of the descriptionfile and some required
  387. or useful defines. First it contains a struct WinInfo that has the name which
  388. was set using the command projectname. This struct is required for rendering
  389. the GUI to the window, therefore it is the most important structure in the
  390. headerfile. Furthermore an array of pointers to gadgets is allocated in the
  391. headerfile. This array has the name of the project plus the suffix "_Gadgets"
  392. and contains the pointers to the gadgets which you require for e.g. setting
  393. new attributes of the gadgets. To know which entry in this array belongs to
  394. a certain gadget, GenGui generates a definition for every Gadget, which tells
  395. you which entry belongs to a certain gadget. The name of this definition
  396. consists of two parts: the projectname and, seperated by an underscore, the
  397. ID of the gadget. OK, let's have a simple example to illustrate, how you
  398. would use it. The second headerfile has the extension "_def.h" and contains
  399. only the structure definitions, the prototypes and the #defines. It is
  400. useful if you want to access the GUI from another module.
  401.  
  402. This could be a description of a GUI:
  403.  
  404. #c_source
  405.  
  406. #define ExampleButton 1  // I want to have a more telling name than a number
  407.  
  408. #end_source
  409.  
  410. Projectname Test
  411. VBOX
  412.    BUTTON
  413.       TEXT "Test"
  414.       ID ExampleButton
  415.    end
  416. end
  417.  
  418.  
  419. To render the GUI to the window you would use:
  420.  
  421.    RenderGui(window,&Test);
  422.  
  423. And to change the attributes of the gadget you would use:
  424.  
  425.    GT_SetGadgetAttrs(Test_Gadgets[Test_ExampleButton],window,NULL, ... );
  426.  
  427. For accessing the contents of string- or integergadgets there are two macros
  428. GetString() and GetNumber(), which take the address of the gadget and return
  429. the contents of the gadget. Since GenGui needs the field "UserData" for
  430. internal use and it reserves another field for this purpose, it generates a
  431. new macro GetUserData() that fullfills the purpose to accessing this field
  432. for userdata.
  433. For the handling of customgadgets you require some additional defines:
  434. First there are some modes defined, whose meaning is explained in the
  435. chapter for customgadgets. Furthermore there is a macro GetInfo(), which
  436. gives you the address of the GadInfo that corresponds to a given gadget.
  437.  
  438. The other structures in the headerfile contain the actual data that
  439. describes the GUI. Since they are not important for the programmer their
  440. names consist of the projectname and an extension of some numbers and
  441. characters.
  442.  
  443. If you want to know more of what can be found in the headerfile you should
  444. have a look at the generated source :).
  445.  
  446.  
  447. 4. Writing code using GenGui
  448. ============================
  449. The first thing you have to do is to write the file with the description of
  450. the GUI in the description-language, that was presented in chapter 2. The
  451. filename must have the extension .gui. The next step is to compile this
  452. description to a normal C-headerfile using GenGui:
  453.    GenGui  file.gui
  454.  
  455. You will get two headerfiles: file.h and file_def.h
  456. "file.h" contains the data of the GUI and "file_def.h" contains all from
  457. "file.h" except for the data itself.
  458.  
  459. There are two important aspects:
  460.  - You must use Gui_GetIMsg() instead of GT_GetIMsg()!
  461.  - You must use Gui_SetGadgetAttrs() instead of GT_SetGadgetAttrs()!
  462.  
  463. The following example will show you how to use these GUI's within your own
  464. programs:
  465.  
  466. #include "file.h"  // include the headerfile that was generated by GenGui
  467.  
  468. main()
  469. {
  470.    struct IntuiMessage msg;
  471.    struct WIndow *win;
  472.    int run=1;
  473.  
  474.    /*
  475.  
  476.    . Now open all required libraries and the window. "win" must point to
  477.    . the newly opened window.
  478.  
  479.    */
  480.  
  481.    /* The Projectname of the GUI is TestPro */
  482.  
  483.    if(RenderGui(win,&TestPro)) {/* do the cleanup, send an error msg .... */}
  484.             /* RenderGui returns 0 if successful, an error code on failure */
  485.  
  486.    while(run) {
  487.       WaitPort(win->UserPort);  // you may use Wait instead, if you like :)
  488.  
  489.       while(GuiGetIMsg(win->UserPort,&msg)) {
  490.             /* It is very important that you use this function instead of
  491.                GetMsg or GT_GetIMsg(), since it does some additional
  492.                actions !!! */
  493.  
  494.          switch(msg.Class) {
  495.             case IDCMP_CLOSEWINDOW: run=0;break;
  496.             case IDCMP_NEWSIZE:     ResizeGui(&TestPro); // do the resizing
  497.                                     break;
  498.             case IDCMP_REFRESHWINDOW:
  499.                                     RefreshGui(&TestPro); // and the refresh
  500.                                     break;
  501.             // ... and some more actions you need
  502.          }
  503.       }
  504.    }
  505.  
  506.    FreeGui(&TestPro); // Free the gadgets
  507.  
  508.    /* close the window and free the sources etc. */
  509. }
  510.  
  511. When opening the window you should consider that it must be large enough to
  512. have room for all gadgets. If the window is too small then the GUI will look
  513. quite messed up. The easiest way to determine the needed size of the window
  514. is to check the minimum size for topaz 8 and then scale this size depending
  515. on the size of the used font.
  516.  
  517.  
  518. 5. Hook functions
  519. =================
  520. For every gadget you may define a hook-function. This function is called
  521. whenever Intuition sends a message for this gadget. It receives a copy of
  522. the Intuimessage as parameter and must return an int as result. If you
  523. return null then the Intuimessage is passed on to your main program, in the
  524. other case the Intuimessage is ignored and your program will not receive
  525. this message any more.
  526.  
  527.  
  528. 6. Custom gadgets
  529. =================
  530. Custom gadgets are a very powerful element for generating graphical user
  531. interfaces. They not only allow you to add gadgets other than gadtools
  532. gadgets, you can also use it to render information to the window, that is
  533. not really a gadget, for example some borders or texts, which should
  534. be resizeable. And a special thing which you can create using customgadgets
  535. are multiplexed user interfaces. "What's that?", you may ask. OK, I'll give
  536. you an idea, what you can achieve by this. Imagine that there is not enough
  537. room in the window to place all gadgets in it. Then you could have e.g. a
  538. cyclegadget with which you can select the group of gadgets you want to
  539. be visible in the window.
  540. First at all every customgadget requires a function that handles the
  541. creation of the "gadget". This function gets 7 arguments, the first one is
  542. a pointer to a WinInfo structure, the second one is a pointer to a NewGadget
  543. structure which was filled with all needed data (only MODE_NEW,MODE_RESIZE
  544. and MODE_REFRESH). The third one is a pointer to a GadInfo and the last
  545. four parameters describe the position and the width/height of the area of
  546. gadget.
  547. NOTE: The area of the gadget also contains the spacing around the gadget.
  548.       The (suggested) dimensions of the gadget itself can be found in the
  549.       newgadget structure.
  550.  
  551. This function is called in several cases. It is not only called when the
  552. gadget should be created, but also when it should be removed. There are
  553. 6 Modes, which are marked in 'Mode' field of the WinInfo structure.
  554. The Modes are:
  555.  
  556. MODE_NEW:     A new gadget should be created. If you create gadgets you
  557.               should add them to the GList 'Gadgets' in the WinInfo
  558.               structure and fill 'Prev' in the same structure with the
  559.               pointer to the last gadget.
  560.  
  561. MODE_RESIZE:  The gadget should be resized. Note that you must store the
  562.               state of the gadget, e.g. the contents of a stringgadget and
  563.               if the gadget is disabled. You may store that information in
  564.               the Code field of the delivered GadInfo structure and the
  565.               information if it is disabled can be stored using the flag
  566.               BOXFLG_DISABLED in 'dim.Flags' of this structure. You must not
  567.               change any other bits in this field. Straight after this call
  568.               it will be called with MODE_RESTORE and only then it is
  569.               allowed to use GT_SetGadgetAttrs() to change the state of
  570.               gadtools gadgets, since during the MODE_REISZE call the
  571.               gadgets are not bound to the window yet and GT_SetGadgetAttrs()
  572.               would not work at this point.
  573.  
  574. MODE_REFRESH: Redraw the gadget. You need not redraw system-gadgets, since
  575.               RefreshGList() is called internally.
  576.  
  577. MODE_FREE:    Free the gadget.
  578.  
  579. MODE_BACKUP:  Store the complete information of the gadget e.g. in the
  580.               fields that are named in the description of MODE_RESIZE.
  581.  
  582. MODE_RESTORE: Restore the information that was stored with MODE_BACKUP or
  583.               MODE_RESIZE.
  584.  
  585.  
  586. If you just want to draw some lines, you should ignore the latter three
  587. cases that are only important for the handling of gadgets or 'SubGui's. In
  588. these cases the contents of the NewGadget structure are not valid, however
  589. you will get a pointer to such a structure to avoid enforcer-hits.
  590. You can also use the field Render in the WinInfo structure to determine if
  591. you have draw your lines. It is set to 1 if drawing is needed and to 0 if
  592. not.
  593.  
  594. You must return 0 if everything was OK and any value !=0 if an error
  595. occurred.
  596.  
  597. If you want to draw some lines and render another GUI in this area you can
  598. use "SubGuis". Therefore you must describe a complete GUI just like before
  599. and render this GUI with SubGui() to the window. This function takes the
  600. same parameters as RenderGui() plus four additional parameters which
  601. describe the position and the dimensions of the GUI. You must call this
  602. every time your customfunction is called. This function return 0 on success
  603. and an value !=0 if an error occurred. In this case your function must
  604. also return a value !=0 to tell that there was an error.
  605. There is another thing that is possible using 'SubGuis', that are
  606. multiplexed user-interfaces. You might have several groups of gadgets that
  607. are rendered to the same place in the window and e.g. a global variable
  608. decides which of these groups is displayed in the window. Note that you must
  609. remove the complete GUI from the window first, if you want to switch the
  610. groups, but you cannot use FreeGui(), since this would lose the complete
  611. information that is stored in the GUI. StopGui() exists for this case. It
  612. stores this information and removes the GUI after this. The next time you
  613. call RenderGUI this information is restored. StopGUI() can also be used
  614. if you want to keep informations although you want to close the window,
  615. because you might reopen it later. See also the example for multiplexed
  616. interfaces.
  617.  
  618.  
  619. 7. The functions in the runtime-library "gui_lnk.o"
  620. ===================================================
  621.  
  622. Gui_GetIMsg:
  623.  
  624.    struct IntuiMessage *Gui_GetIMsg(struct MsgPort *,struct IntuiMessage *)
  625.  
  626.    You must call this function instead of GT_GetIMsg() or GetMsg(). Unlike
  627.    these function it requires also pointer to an 'IntuiMessage' structure
  628.    where it stores a copy of the received IntuiMessage. Internally it calls
  629.    GT_ReplyMsg(), therefore you need not call this any more. It returns
  630.    the pointer of the given IntuiMessage, if there is a message of interest
  631.    for the program, otherwise it returns NULL. This is for example the case
  632.    if you have a hook-function seleced for a gadget which returns a value
  633.    !=0 to indicate that the message may be ignored.
  634.  
  635.  
  636. Gui_SetGadgetAttrs / Gui_SetGadgetAttrsA:
  637.  
  638.    BOOL Gui_SetGadgetAttrsA(struct Gadget *, struct Window *,
  639.                            struct Requester *, struct TagItem *)
  640.  
  641.    BOOL Gui_SetGadgetAttrs(struct Gadget *, struct Window *,
  642.                            struct Requester *, Tag, ...)
  643.  
  644.  
  645.    This is a replacemet for the function GT_SetGadgetAttrs of
  646.    gadtools.library. You must call this function instead of that of gadtools,
  647.    since Gengui needs to keep track of the information stored in the gadgets.
  648.    NOTE: Whereas the gadtools function returns VOID this one returns if it
  649.          was successful to modify the attributes. If there is not enough
  650.          memory it returns 0 to indicate that there was an error and the
  651.          attributes are not changed.
  652.  
  653. RenderGui:
  654.  
  655.    int RenderGui(struct Window *win, struct WinInfo *winfo)
  656.  
  657.    RenderGui draws the gadgets to the window. You must supply the pointer
  658.    to the window and the pointer to the WinInfo structure of your GUI.
  659.    This one can be obtained by using the & operator on the name that was
  660.    selected using "PROJECTMAME" in the descriptionfile.
  661.    It returns 0 if everything was OK.
  662.  
  663.  
  664. ResizeGui:
  665.  
  666.    int ResizeGui(struct WinInfo *winfo)
  667.  
  668.    This function is used to adapt the GUI to the new size when a window
  669.    has been resized. You must call this function every time you receive
  670.    a IDCMP_NEWSIZE message.
  671.    It returns 0 if everything was OK.
  672.  
  673. RefreshGui:
  674.  
  675.    int RefreshGui(struct WinInfo *winfo)
  676.  
  677.    This function is used to refresh the gadgets within the window.
  678.    It is only important if you are using SimpleRefresh, since only then it
  679.    is your job to refresh the window. If you are using SmartRefresh windows
  680.    then it should not be required since the system does that job for you.
  681.    It returns 0 if everything was OK.
  682.  
  683. FreeGui:
  684.  
  685.    void  FreeGui(struct WinInfo *winfo)
  686.  
  687.    FreeGui removes the gadgets from the window.
  688.  
  689. StopGui:
  690.  
  691.    void StopGui(struct WinInfo *winfo)
  692.  
  693.    StopGui() stores the information of the gadgets and removes them after
  694.    this from the window. RenderGui() will recognize if the information was
  695.    stored and will restore them if this was the case.
  696.  
  697. SubGui:
  698.  
  699.    int SubGui(struct WinInfo *parent, struct WinInfo *winfo,
  700.               int left,int top,int width, int height)
  701.  
  702.    SubGui allows to draw GUIs within another GUI. You must not use this
  703.    function for other purposes. It is not possible to render a GUI only
  704.    with this function. You must use RenderGui for this, since it allocates
  705.    some additional resources wich are also required by SubGui and must be
  706.    already allocated when SubGui is called.
  707.  
  708.  
  709. ClearWindow:
  710.  
  711.    void ClearWindow(struct Window *)
  712.  
  713.    Removes all contents from the window, erases the inner of the window
  714.    with the EraseRect() and refreshes the windowborders.
  715.  
  716.  
  717. 8. Compiling
  718. ============
  719.  
  720. You need to compile gui_lnk.c in the Gui_lib directory and link this to
  721. your program. Of course you need not recompile it every time. Just compile
  722. it with your favourite C-compiler and then link gui_lnk.o to your program.
  723.  
  724.  
  725.